package com.fantasy.autotrigger;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;

import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import org.apache.poi.ss.usermodel.Cell;

public class AutoTrigger {

	public void auto(String fileName) {
		File file = null;
		file = new File(fileName);
		InputStream rptXlsInput;
		try {
			rptXlsInput = new FileInputStream(file);

			POIFSFileSystem fs = new POIFSFileSystem(rptXlsInput);

			HSSFWorkbook wb = new HSSFWorkbook(fs);

			HSSFSheet sheet = wb.getSheetAt(0);

			// 得到总行数
			int rowNum = sheet.getLastRowNum();
			HSSFRow row = sheet.getRow(1);
			// System.out.println("=============-------------------------==============");
			for (int i = 0; i <= rowNum; i++) {
				row = sheet.getRow(i);
				for (@SuppressWarnings("unused") Cell cell : row) {
					
				}
			}
			wb.close();
			fs.close();
		} catch (FileNotFoundException e) {
		} catch (IOException e) {
		}
	}
}
